import request from '@/utils/request'

// 查询请假列表
export function listLeave(query) {
  return request({
    url: '/activiti/leave/list',
    method: 'post',
    params: query
  })
}
// 增加请假业务
export function addLeave(query) {
  return request({
    url: '/activiti/leave/add',
    method: 'post',
    params: query
  })
}
// 删除请假业务
export function removeLeave(query) {
  return request({
    url: '/activiti/leave/remove',
    method: 'post',
    params: query
  })
}
// 修改请假业务
export function editLeave(query) {
  return request({
    url: '/activiti/leave/edit',
    method: 'post',
    params: query
  })
}
// 提交请假业务
export function submitApplyLeave(query) {
  return request({
    url: '/activiti/leave/submitApply',
    method: 'post',
    params: query
  })
}
// 查看历史审批
export function listHistoryLeave(query) {
  return request({
    url: '/activiti/process/listHistory',
    method: 'post',
    params: query
  })
}
// 查看我的待办
export function taskListLeave(query) {
  return request({
    url: '/activiti/leave/taskList',
    method: 'post',
    params: query
  })
}
//审批
export function approvalLeave(taskId) {
  return request({
    url: '/activiti/leave/complete/'+taskId,
    params: taskId
  })
}
//查看我的已办
export function listMyDone(bizLeave) {
  return request({
    url: '/activiti/leave/taskDoneList',
    method: 'post',
    params: bizLeave
  })
}
//查看我的已办
export function suspendOrActiveApply(instanceId) {
  return request({
    url: '/activiti/process/suspendOrActiveApply',
    method: 'post',
    params: instanceId
  })
}
//撤销
export function cancelApply(instanceId) {
  return request({
    url: '/activiti/process/cancelApply',
    method: 'post',
    params: instanceId
  })
}

//委托
export function deleget(taskId,delegateToUser) {
  return request({
    url: '/activiti/process/delegate',
    method: 'post',
    params: taskId,delegateToUser
  })
}